// 设置cookie
function set_cookie(key, val){
    let d = new Date();
    d.setTime(d.getTime()+(24*60*60*1000))
    let expires="expires="+d.toGMTString();
    document.cookie=key+"="+val;
}
// 获得cookie
function get_cookie(key){
    let name = key+'='
    let ca = document.cookie.split(';')
    for(let i=0; i<ca.length; i++)
    {
        let c = ca[i].trim();
        if(c.indexOf(name)==0) return c.substring(name.length,c.length);
    }
    return ''
}